/-app ...
/-app/tests ...
TestCase.ts
TestPage.ts
Application.ts
/-boot
/-imports
/-storage
/-tests
/-typings
stringUtils.ts
teapo.html
1
module teapo.app.tests {
2
 
3
  export class TestCase {
4
 
5
    state = ko.observable(TestCase.State.NotStarted);
6
    runtime = ko.observable<number>(null);
7
    failure = ko.observable<Error>(null);
8
 
9
    private _started = -1;
10
 
11
    constructor(
12
      public name,
13
      private _test: Function) { 
14
    }
15
 
16
    start() { 
17
      if (this.state() !== TestCase.State.NotStarted)
18
        throw new Error('Test case already started (' + TestCase.State[this.state()] + ').');
19
 
20
      this.state(TestCase.State.Running);
21
      this.runtime(0);
22
      this._started = Date.now();
23
 
24
      try {
25
 
26
      }
27
      catch (error) { 
28
        //
29
      }
30
    }
31
  }
32
 
33
  export module TestCase {
34
 
35
    export enum State {
36
      NotStarted,
37
      Running,
38
      Succeeded,
39
      Failed
40
    }
41
 
42
  }
43
 
44
}